<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>
		找回密码
	</title>

    <meta name="viewport" content="width=device-width"/>
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name = "format-detection" content = "telephone=no">
    
    <link type="text/css" href="css/css.css" rel="stylesheet" />

     <script type="text/javascript">  
    //iOS Web APP中点击链接跳转到Safari 浏览器新标签页的问题 devework.com  
    //stanislav.it/how-to-prevent-ios-standalone-mode-web-apps-from-opening-links-in-safari  
    if(("standalone" in window.navigator) && window.navigator.standalone){  
        var noddy, remotes = false;  
        document.addEventListener('click', function(event) {  
            noddy = event.target;
            while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {  
                noddy = noddy.parentNode;  
            }  
            if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes))  
            {  
                event.preventDefault();  
                document.location.href = noddy.href;  
            }  
        },false);  
    }  
  </script> 

</head>
<body>
<div class="login">
    <div class="header">
    <table width="100%" border="0" cellspacing="0" class="header_nav">
        <tr>
            <td width="10%" class="nav_left1"><a  href='javascript:window.history.go(-1)'><</a></td>
            <td width="70%" class="nav_title">找回密码</td>
            <td width="20%" class="nav_r"></td>
        </tr>
    </table>
    </div>
        <div class="logo"></div>
        <div class="main">
        	<table width="100%" border="0" cellspacing="0" class="mainl">
            	<tr>
                    <td class="text"><input type="text/css" id="username" placeholder="请输入您的用户名" class="text1"/></td>
                </tr>
            </table>
            <div class="linee"></div>
			<table width="100%" border="0" cellspacing="0" class="mainl">
                <tr>
                    <td class="text"><input type="text/css" id="email" placeholder="请输入您的e-mail" class="text1"/></td>
                </tr>
            </table>
            <div class="linee"></div>
            <table width="100%" border="0" cellspacing="0" class="mainl">
                <tr>
                    <td class="text"><input type="text/css" id="telephone" placeholder="请输入您的电话" class="text1"/></td>
                </tr>
            </table>
            <div class="linee"></div>
            <table width="100%" border="0" cellspacing="0" class="mainl">
                <tr>
                    <td class="text"><input type="text/css" id="newpassword" placeholder="请输入您的新密码" class="text1"/></td>
                </tr>
            </table>
            <div class="linee"></div>

        </div>
        <div class="button"><input type="submit" onclick="javascript:zhaohui()" value="找回密码" class="text2" /></div>
    </div>
<script src="js/jquery.min.js"></script>
	<script src="js/app.js"></script>
</body>

<script type="text/javascript">
	function zhaohui(){
      	$.ajax({
            url: "http://libkindle.com:8080/WebSell/LoginServlet",
            type: 'GET',
            dataType: 'json',
            data: {
				action:"retrieve",
            	username:$("#username").val(),
				email:$("#email").val(),
				telephone:$("#telephone").val(),
				newpassword:$("#newpassword").val()
            },
            success: function(data,status,xhr) {  
					if(data.code==0)
					{
					alert(data.msg);
           			location.href = "login.html";}      
					else
					{alert(data.msg);
					}
            },
            error: function() {
            	alert("密码修改失败");
            	window.location.href = "#";
            }
        });
    };
</script>


</html>